package com.出现1的次数;

public class Solution {
	public int NumberOf1Between1AndN_Solution(int n) {
		int res=0;
		StringBuffer s = new StringBuffer();
		for(int i=1;i<=n;i++) {
		   String temp=String.valueOf(i);
		   s.append(temp);
		}
		for(int i=0;i<s.length();i++) {
			if(s.charAt(i)=='1') {
				res++;
			}
		}
		return res;
		

	}
}
